package cn.jg.framework.auth.session;

import cn.jg.framework.auth.model.Company;

public class ThreadLocalCompany {
	private static final ThreadLocal<Company> COMPANY_THREAD_LOCAL = new InheritableThreadLocal<>();

	public static void set(final Company company) {
		COMPANY_THREAD_LOCAL.set(company);
	}

	public static void set(int id) {
		Company c = new Company(id);
		COMPANY_THREAD_LOCAL.set(c);
	}

	public static Company get() {
		return COMPANY_THREAD_LOCAL.get();
	}

	public static void remove() {
		COMPANY_THREAD_LOCAL.remove();
	}
}
